using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using BVMB.DataLayer.BusinessObjects;
using BVMB.DataLayer.Base;

namespace BVMB.DataLayer.ManagerObjects
{
    public partial interface IVeManager : IManagerBase<BVMB.DataLayer.BusinessObjects.Ve, int>
    {
		// Get Methods
		IList<Ve> GetByMaChuyenBay(System.Int32 chuyenBay);
		IList<Ve> GetByMaHangVe(System.Int32 hangVe);
		IList<Ve> GetByMaHanhKhach(System.Int32 hanhKhach);
    }

    partial class VeManager : ManagerBase<BVMB.DataLayer.BusinessObjects.Ve, int>, IVeManager
    {
		#region Constructors
		
		public VeManager() : base()
        {
        }
        public VeManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Ve> GetByMaChuyenBay(System.Int32 chuyenBay)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Ve));
			
			
			ICriteria chuyenBayCriteria = criteria.CreateCriteria("ChuyenBay");
            chuyenBayCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", chuyenBay));
			
			return criteria.List<Ve>();
        }
		
		public IList<Ve> GetByMaHangVe(System.Int32 hangVe)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Ve));
			
			
			ICriteria hangVeCriteria = criteria.CreateCriteria("HangVe");
            hangVeCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", hangVe));
			
			return criteria.List<Ve>();
        }
		
		public IList<Ve> GetByMaHanhKhach(System.Int32 hanhKhach)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Ve));
			
			
			ICriteria hanhKhachCriteria = criteria.CreateCriteria("HanhKhach");
            hanhKhachCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", hanhKhach));
			
			return criteria.List<Ve>();
        }
		
		#endregion
    }
}